#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
int main()
{
	int n = 1;
	int i = 1;
	int ret = 1;
	int a = 4;
	int sum = 0;
	for (n = 1;n <= a;n++) {
		ret = 1;
         for (i = 1;i <= n;i++) {
			 
		     ret = ret * i;
	     }
		sum = sum + ret;
	}
	printf("%d", sum);

	return 0;
};